import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    redirect: '/index'
  },
  // {
  //   path: "/show",
  //   name:'show',
  //   component: () => import("@/views/Loading/Loading.vue")  //动画过渡 
  // },
  {
    path: "/index",
    name: "index",
    mate: { title: "湖北高校防艾活动" },
    component: () => import("@/views/Login/index.vue")  //首页
  },
  {
    path: "/activityList",
    name: "activityList",
    meta: { title: "活动列表" },
    component: () => import("@/views/jkongpage/activityList.vue")
  }, {
    path: "/jKongList",
    name: "jKongList",
    meta: { title: "活动列表" },
    component: () => import("@/views/jkongpage/jKongList.vue") //疾控列表
  },
  {
    path: "/provincialmap",
    name: "provincialmap",
    meta: { title: "湖北高校防艾活动" },
    component: () => import("@/views/Login/provincialmap.vue")  //(省地图)
  },

  {
    path: "/citymap/:cityIndex",
    name: "citymap",
    meta: { title: "" },
    component: () => import("@/views/Login/citymap.vue")  //（市区地图）
  },
  {
    path: "/schoolList",
    name: "schoolList",
    meta: { title: "湖北高校列表" },
    component: () => import("@/views/School/schoolList.vue")  // 高校列表
  },
  {
    path: "/schoolindex",
    name: "schoolindex",
    meta: { title: "" },
    component: () => import("@/views/School/schoolindex.vue")  // 学校主页
  },
  {
    path: "/activityRecord",
    name: "activityRecord",
    meta: { title: "" },
    component: () => import("@/views/Information/activityRecord.vue")  //
  },
  {
    path: "/medal",
    name: "medal",
    meta: { title: "我的勋章墙" },
    component: () => import('@/views/Information/medal.vue')  //我的勋章
  },{
    path:"/medalDetails",
    name:"medalDetails",
    meta:{title:"勋章详情"},
    component:()=>import('@/views/Information/medalDetails.vue')
  },
  {
    path: "/unitHomePage",
    name: "unitHomePage",
    meta: { title: "疾控主页" },
    component: () => import('@/views/jkongpage/unitHomePage.vue') //省疾控主页
  },
  {
    path: "/schoolProblemPage",
    name: "schoolProblemPage",
    mate: { title: "" },
    component: () => import('@/views/School/schoolProblemPage.vue') //题目
  }, {
    path: "/rankingPage",
    name: "rankingPage",
    mate: { title: "高校排行榜" },
    component: () => import('@/views/School/rankingPage.vue')
  }, {
    path: "/messageList",
    name: "messageList",
    mate: { title: "活动资讯" },
    component: () => import('@/views/message/messageList.vue')//资讯列表
  }, {
    path: "/messageDetail",
    name: "messageDetail",
    mate: { title: "防艾资讯" },
    component: () => import('@/views/message/messageDetail.vue')
  }, {
    path: "/turntable",
    name: "turntable",
    mate: { title: "抽奖" },
    component: () => import('@/views/School/turntable.vue')
  }, {
    path: "/finishpage",
    name: "finishpage",
    mate: { title: "湖北高校防艾活动" },
    component: () => import('@/views/School/finishpage.vue') //活动结束页面
  }, {
    path: "/offlinePage",
    name: "offlinePage",
    mate: { title: "线下活动详情" },
    component: () => import('@/views/District/offlinePage.vue') //活动结束页面
  }, {
    path: "/eventDetails",
    name: "eventDetails",
    mate: { title: "" },
    component: () => import('@/views/District/eventDetails.vue') //线下活动介绍页面
  },
  {
    path: "/personalinfo",
    name: "personalinfo",
    mate: { title: "个人中心" },
    component: () => import('@/views/Information/personalinfo.vue')  //个人中心
  }, {
    path: "/editInfoPage",
    name: "editInfoPage",
    mate: { title: "个人信息-编辑" },
    component: () => import('@/views/Information/editInfoPage.vue')
  },
  {
    path: "*",
    redirect: '/index'
  },

]

const router = new VueRouter({
  routes
})

router.afterEach((to, from, next) => {
  window.scrollTo(0, 0);
});
export default router
